<div id="content">
	<h1>Home</h1>
		<center><img src="<%= url_for(:controller => 'home', :action => 'course_material', :id => @course_material.id) %>" /></center>
	<br />

	<% if(session[:loginrole] == "Admin") %>
		<% form_for :course_material, :url => {:controller=>"home", :action => "add_logo"}, :html => { :multipart => true } do |form| -%>
			<div style="border: dashed 1px #CCC; padding:3px 15px;">
			<h3>Upload Class Logo</h3>
				        <table>
					    <tr>
					    <td align="right">File:</td> <td><%= form.file_field("uploaded_document") %></td>
					    <td><%= submit_tag("Upload file" ) %></td>
					    </tr>
					    </table>
					    <i>Please make sure to upload a jpg file for the class logo.</i>
			</div>
		<% end %>
	<% end %>
	
	<br />
	<div style="border: dashed 1px #CCC; padding:3px 15px;">
		<h3>Announcements</h3>
	
		<br />	
		<% for news in @listing %>
			<div class="comment">
			<p><%= news.content %></p>
			<i> - <%= h(news.created_at) %></i></div> 
		<% end %>
		
		<% if(session[:loginrole] == "Admin") %>
			<p>
			<% form_remote_tag :url => {:controller=>"home", :action => "add_announcement"} do -%>
				<%= text_area_tag :newAnnouncement, nil, :style => 'width:50%; height:80px;' %><br />
				<%= submit_tag "Add Announcement" %>
			<% end %>
			</p>
			<p>
			<% form_remote_tag :url => {:controller=>"home", :action => "Delete_all_announcements"} do -%>
				<%= submit_tag "Delete all Announcements" %>
			<% end %>
			</p>
		<% end %>	
	</div>

</div>